<?php
error_reporting(0);
session_start();
include_once '../comm/config.php';
include_once '../comm/checkpostandget.php';
include_once 'check.php';
include_once '../comm/wjt.php';

$id=$_GET["id"]; 
$hlink = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$hlink) {
	die(ERR_DB);
}
else
{
	mysql_query("set names utf8");
	$sql="select * from ".$BIAOTOU."mall_order where id=".$id."";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	while($row = mysql_fetch_object($rs)) 
	{
			$order_code=$row->order_code; 
			$th="";
			for($len=strlen($order_code)-3;$len>0;$len=$len-1)
			{
				$th=$th."*";
			}
			$order_code=substr($order_code,0,1)."".$th."".substr($order_code,strlen($order_code)-1,1);
			$order_time=$row->order_time; 
			$merchant_id=$row->merchant_id; 
			$item_price=$row->item_price; 
			$seller_nick=$row->seller_nick; 
			$item_count=$row->item_count; 
			$fxje=mall_ck_fxje($row->commission,$_SESSION["dduserlevel"]);
	}
}
mysql_close($hlink);
$tag="center";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>找回订单 - 用户中心</title>
<link href="../css/usercss.css" rel="stylesheet" type="text/css">
<link href="../template/<?=MOBAN?>/css/common.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../js/jquery.js"></script>
<script language="javascript" type="text/javascript">
function checkjyh()
{
		var str1 = document.getElementById("jyh").value;    
        if(str1.length!=0)
		{     
				document.getElementById("ckjyh").innerHTML = '<img src=../images/dui.gif alt="正确" align=absmiddle />';
				return true;
		}
		else
		{
				document.getElementById("ckjyh").innerHTML = '<img src=../images/cuo.gif alt="错误" align=absmiddle /> <font color=#ff0000>请填写订单号</font>';
				return false;
		}
} 
function checkyzm()
{
		var str1 = document.getElementById("yzm").value;    
        if(str1.length==4)
		{     
				document.getElementById("ckyzm").innerHTML = '<img src=../images/dui.gif alt="正确" align=absmiddle />';
				return true;
		}
		else
		{
				document.getElementById("ckyzm").innerHTML = '<img src=../images/cuo.gif alt="错误" align=absmiddle /> <font color=#ff0000>验证码错误</font>';
				return false;
		}
}   
function checkall()
{
	if(!checkjyh()||!checkyzm())
	{
		return false;
	}
	else
	{
		return true;
	}
}
</script>
</head>

<body id="tradelist">
<?php
include("../template/".MOBAN."/header.tpl.php");
?>
<?php
include("../template/".MOBAN."/nav.tpl.php");
?>
<div id="main">
<?php
include("left.php");
?>
<div class="contain">
  <h2 class="left_nav2">找回订单(商城)</h2>
    <div class="order">
    <div class="content" style="font-size:12px;">
<form id="form2" name="form2" method="post" action="queren_mall_save.php" onsubmit="return checkall()">
                        <table width="680" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="680" height="38" align="left"><div style="border:1px solid #FFCC7F; background-color:#FFFFE5; padding:8px;">注：如果您发现系统没有自动返现给您，可能是您购买商品的时候未登录，请输入交易号进行确认，只要您输入的商城交易号与系统内的一致，这笔交易您就确认成功了。</div></td>
                          </tr>
          </table>
                        <table width="680" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="121" height="35" align="right">商城名称：</td>
                          <td height="35" colspan="2" align="left">&nbsp;<font color="#dd0000"><?php echo $merchant_id;?></font>
                          <input type="hidden" name="id" value="<?php echo $id;?>" /><input type="hidden" name="merchant_id" value="<?php echo $merchant_id;?>" /></td>
                        </tr>
						 
                        <tr>
                          <td height="35" align="right">交易号：</td>
                          <td height="35" colspan="2" align="left">&nbsp;<font color="#dd0000"><?php echo $order_code;?></font>
                            
                          </span></td>
                        </tr>
                        <tr>
                          <td height="35" align="right">单&nbsp;&nbsp;价：</td>
                          <td height="35" colspan="2" align="left">&nbsp;<font color="#dd0000"><?php echo $item_price;?> ( 成交数量：<?php echo $item_count;?> )</font></td>
                        </tr>
                        <tr>
                          <td height="35" align="right">返现金额：</td>
                          <td height="35" colspan="2" align="left">&nbsp;<font color="#dd0000"><?php echo $fxje;?></font></td>
                        </tr>
                        <tr>
                          <td height="35" align="right">输入交易号：</td>
                          <td width="209" height="35" align="left">
                          <input name="jyh" type="text" id="jyh" maxlength="20" onblur="checkjyh();" /></td>
                          <td width="350" align="left" id="ckjyh">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="35" align="right">验证码：</td>
                          <td height="35" align="left"><input name="yzm" type="text" size="10" maxlength="4"  onblur="checkyzm();" />
                          <img src="../comm/yzm.php" align="absmiddle" border="0" /></td>
                          <td height="35" align="left" id="ckyzm">&nbsp;</td>
                        </tr>
                        <tr>
                          <td height="35" align="right">&nbsp;</td>
                          <td height="35" colspan="2" align="left"><input type="submit" name="Submit2" value="找回订单" class="smtgray" /></td>
                        </tr>
          </table>
        </form>
					  </div>
	</div>
</div>
</div>
<?php
include("../template/".MOBAN."/footer.tpl.php");
?>
</body>
</html>